package jjn.round1;

/**
 * @author Jjn
 * @since 2022/7/25 23:25
 */
public class LeetCode268_MissingNumber {

    public int missingNumber(int[] nums) {
        boolean[] data = new boolean[nums.length + 1];
        for(int num : nums) {
            data[num] = true;
        }
        for (int i = 0;; i++) {
            if (!data[i]) {
                return i;
            }
        }
    }
}
